package org.wevil.entity.log;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.wevil.anno.DataMasking;
import org.wevil.anno.DataMaskingFunc;

import javax.persistence.*;
import java.sql.Timestamp;

@EntityListeners(AuditingEntityListener.class)
@Entity
@Getter
@Setter
public class LogLogin {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    Integer id;
    @DataMasking
    String username;
    @DataMasking(maskFunc = DataMaskingFunc.PHONE)
    String tel;
    String password;
    String reqIp;
    Integer resCode;
    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    Timestamp ts;
}
